package Reflection;

import java.lang.reflect.Field;

public class demo7 {
    public static void main(String[] args) {
        //先获取Class对象
        Class c = Cat.class;
        //再获取成员变量(只能获取全部的成员变量)
        Field[] fields = c.getDeclaredFields();
        for (Field field : fields) {
            System.out.println(field.getName());
        }
    }
}
